With development of networks, a wireless network is applied increasingly widely. Especially, in public places such as cafes, hotels, and shopping malls, a wireless network is provided for users to connect to. For example, in the foregoing places, usually a Wi-Fi (Wireless Fidelity, Wireless Fidelity) connection function is provided, so that electronic devices can access networks by means of Wi-Fi.
Currently, a user needs to manually enter Wi-Fi access information before the user accesses a network by means of Wi-Fi. An operation manner in which the Wi-Fi access information is manually entered is relatively complex, and because the Wi-Fi access information is manually entered by the user, the Wi-Fi access information may be entered incorrectly. Therefore, accuracy of entering the Wi-Fi access information is reduced, and an electronic device fails to access the Wi-Fi network.